package me.thinkjet.controller.common;

import com.jfinal.core.Controller;
import com.jfinal.ext.route.ControllerBind;
import me.thinkjet.model.Area;
import me.thinkjet.service.UploadService;

import java.io.File;

@ControllerBind(controllerKey = "/area", viewPath = "")
public class AreaController extends Controller {

	public void index() {
		int parent = getParaToInt() == null ? 0 : getParaToInt();
		setAttr("area", Area.dao.findByCache("area", "area" + parent,
				"select * from area where parent=?", parent));
		renderJson();
	}

	public void hot() {
		setAttr("area", Area.dao.findByCache("area", "area_hot", "select * from area where hot=1 limit 0,10"));
		this.renderJson();
	}
}
